package com.meilai.project.service.business.contract;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.meilai.project.controller.web.business.contract.dto.ContractApplySaveReq;
import com.meilai.project.controller.web.business.contract.dto.ContractAttachmentReq;
import com.meilai.project.dto.base.ApiResult;
import com.meilai.project.dto.business.contract.*;
import com.meilai.project.entity.business.contract.ContractApply;
import com.meilai.project.entity.business.contract.ContractAttachment;
import com.meilai.project.vo.business.contract.ContractApplyForADMakeVO;
import com.meilai.project.vo.business.contract.ContractApplyVO;
import com.meilai.project.vo.business.contract.NotCompleteSaleContractVO;

import java.util.List;

/**
 * <p>
 * 入编申请 服务类
 * </p>
 *
 * @author xchen
 * @since 2022-01-20
 */
public interface ContractApplyService extends IService<ContractApply> {

    List<ContractApplyVO> listByRootContractId(Long root_id);
    List<NotCompleteSaleContractVO> listNotComplete(Long userId);
    //生成合同
    Long generateContract(ContractGenerateDTO req);

    ContractAttachment saveAttachment(ContractAttachmentReq contractAttachmentReq);

    List<String> partAHistory(Long customerId);

    // 获取列表
    Page<ContractApplyVO> selectPageList(ContractApplyListDTO searchDTO);

    Page<ContractApplyVO> selectLatestPageList(ContractApplyLatestListDTO searchDTO);

    List<ContractApplyVO> listByRootId(Long rootId);

    List<ContractApplyVO> listLatestByCustomerId(Long customerId);

    List<ContractApplyVO> listForMarketByCustomerId(Long customerId, Long mustIncludeContractId);

    List<ContractApplyForADMakeVO> listForADMakeByDeptId(Long customer_id, Long mustIncludeContractId);
    //按类型查询补充协议列表分页
    Page<ContractApplyVO> selectPageAmendList(ContractApplyAmendListDTO searchDTO);
    // 获取详情
    ContractApplyVO getOneById(Long id);
    // 保存附件
    boolean saveAttachment(ContractApplySaveReq req);

    // 保存
    ApiResult<Boolean> save(ContractApplySaveReq req);

    // 提交
    ApiResult<Boolean> begin(ContractApplySaveReq dto);

    // 通过
    boolean pass(ContractApplyCheckDTO dto);

    // 驳回
    boolean returnBack(ContractApplyCheckDTO dto);

    // 删除
    boolean delete(Long id);

    // 彻底删除
    boolean actualDelete(Long id);

    // 挂起
    void hangUp(List<Long> chooseIdList);

    void cancelHangUp(List<Long> chooseIdList);

    void invalidByChooseIds(List<Long> chooseIdList);

    List<ContractApplyVO> list_by_customer_id(Long customerId);
    // 获取详情
    List<ContractApplyVO> getListByIds(List<Long> ids);

    List<ContractApply> get_contract_list_by_reimburse();
}
